package com.ykq.controller;

import com.ykq.service.MenuService;
import com.ykq.util.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;

/**
 * @program: qy145-key
 * @description:
 * @author: 闫克起2
 * @create: 2021-12-16 11:52
 **/
@RestController
@RequestMapping("/menu")
public class MenuController {
    @Autowired
    private MenuService menuService;

    @RequestMapping("findLeftMenu")
    public CommonResult findLeftMenu(){
        return menuService.findByUserRid();
    }


    @RequestMapping("treeMenu")
    public CommonResult treeMenu(){
        return menuService.findAllMenu();
    }

    @RequestMapping("findRoleMenuId")
    public CommonResult findRoleMenuId(Integer rid){
          return menuService.findRoleMenuId(rid);
    }

    @RequestMapping("/confirmPermission")
    public CommonResult confirmPermission(Integer[]menuId,Integer rid){
        return menuService.confirmPermission(menuId,rid);
    }
}
